# Scanner makefile

SRCS = $(wildcard *.cpp)
OBJS = $(SRCS:.cpp=.o)
INCS = $(wildcard *.h)

TARGETLIB = libScanner.so
TARGET = scanner

CXXFLAGS = -O2 -Wall -fPIC -c
LDFLAGS  = -shared -Wl,-soname,$(TARGET)
# LIBS   =
LIBS     = -L../Buffer -L../Symboltable -lBuffer -lSymboltable

CXXFLAGS = -O2 -Wall -c
LDFLAGS  =

%.o: %.cpp
	$(CXX) $(CXXFLAGS) $< -o $@

$(TARGET): $(OBJS)
	$(CXX) $(LDFLAGS) $(OBJS) -o $@ $(LIBS)

debug: CXX += -DDEBUG -g
debug: all

release: all

all: $(TARGET)

.PHONY: clean
clean:
	rm -f $(OBJS) $(TARGET)
